﻿package com.wandian.controller
{
	import com.wandian.data.GameData;
	import com.wandian.model.AccountProxy;
	import com.wandian.model.BankProxy;
	import com.wandian.model.socket.ServerPacketProxy;
	import com.wandian.model.vo.PlayerVo;
	import com.wandian.model.vo.RoomVo;
	import com.wandian.view.mediator.BuyInMediator;
	import com.wandian.view.mediator.GameRoomMediator;
	import com.wandian.view.mediator.MaskGameMediator;
	import com.wandian.view.mediator.account.AccountMediator;
	import com.wandian.view.mediator.bank.BankMediator;
	
	import flash.display.MovieClip;
	
	import org.puremvc.as3.interfaces.*;
	import org.puremvc.as3.patterns.command.*;

    public class BuyInCommand extends SimpleCommand
    {
        private var _global:GameData;
        private var _mcBuyIn:MovieClip;

        public function BuyInCommand()
        {
            this._global = GameData.getInstance();
            return;
        }

        override public function execute(notification:INotification) : void
        {
            super.execute(notification);
            switch(notification.getName())
            {
                case CLZNoticeName.BUY_IN_WINDOS_SHOW:
                {
                    this.showBuyIn(notification);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }
		//点坐位,显示买入
        private function showBuyIn(notification:INotification) : void
        {
            var data:* = notification.getBody();
            if (!this._mcBuyIn)
            {
                this._mcBuyIn = GameData.getMovieClip("BuyInPanel");
            }
            if (!Texas.I._mcWindosView.contains(this._mcBuyIn))
            {
                Texas.I._mcWindosView.addChildTo(this._mcBuyIn);
            }
            Texas.I._mcWindosView.centerXY(this._mcBuyIn);
            if (facade.hasMediator(BuyInMediator.NAME))
            {
                return;
            }
            facade.registerMediator(new BuyInMediator(this._mcBuyIn, data));
            return;
        }

    }
}
